@code_tooltip_harvest = `harvest()`
收获无人机下方的实体。
如果对一个无法收获的实体执行收获，则它将被摧毁。

如果移除了一个实体，则返回 `True`，否则返回 `False`。

如果移除了一个实体，需要 `200` ticks 执行，否则需要 `1` tick。

示例：
`harvest()`
@code_tooltip_can_harvest = `can_harvest()`
用于判断植物是否完全成熟。

如果无人机下方有可以收获的实体，则返回 `True`，否则返回 `False`。

需要 `1` tick 执行。

示例：
`if can_harvest():
    harvest()`
@code_tooltip_range = `range(start = 0, end, step = 1)`
生成一个数字序列，从 `start` 开始，在到达 `end` 之前结束（所以不包括 `end`），步长为 `step`。

注意，`start` 默认设置为 `0`，如果只给出一个参数，则会绑定到 `end`。这在通常情况下是不可能的。
而在 Python 中，`range` 是一个类构造函数，允许这种奇怪的行为。

需要 `1` tick 执行。

示例：
`for i in range(10):
    print(i)

for i in range(2,6):
    print(i)

for i in range(10, 0, -1):
    print(i)`
@code_tooltip_plant = `plant(entity)` 
消耗指定 `entity` 所需的成本，并将其种植在无人机下方。
如果成本资源不足、地块类型错误或下方已有植物，则种植会失败。

如果成功，则返回 `True`，否则返回 `False`。

如果成功，需要 `200` ticks 执行，否则需要 `1` tick。

示例：
`plant(Entities.Bush)`
@code_tooltip_move = `move(direction)`
使无人机向指定 `direction` 移动一格。
如果无人机即将移出农场边缘，则会绕回到农场的另一边。

`East `  =  右
`West `  =  左
`North`  =  上
`South`  =  下

如果无人机移动了，则返回 `True`，否则返回 `False`。

如果无人机移动了，需要 `200` ticks 执行，否则需要 `1` tick。

示例：
`move(North)`
@code_tooltip_can_move = `can_move(direction)`
检查无人机是否可以向指定 `direction` 移动。

如果无人机可以移动，则返回 `True`，否则返回 `False`。

需要 `1` tick 执行。

示例：
`if can_move(North):
    move(North)`
@code_tooltip_swap = `swap(direction)`
将无人机下方的实体与指定 `direction` 方向上相邻的实体交换。
并非对所有实体都有效。
如果其中一个（或两个）实体为 `None`，也同样有效。

如果成功，则返回 `True`，否则返回 `False`。

成功时需要 `200` ticks 执行，否则需要 `1` tick。

示例：
`swap(North)`
@code_tooltip_till = `till()` 
将无人机下方的地块耕成 `Grounds.Soil`。如果已经是土壤，则会把地块变回 `Grounds.Grassland`。

返回 `None`。

需要 `200` ticks 执行。

示例：
`till()`
@code_tooltip_get_pos_x = `get_pos_x()` 
获取无人机当前的 x 坐标。
x 坐标从西边的 `0` 开始，向东递增。

返回一个表示无人机当前 x 坐标的数字。

需要 `1` tick 执行。

示例：
`x, y = get_pos_x(), get_pos_y()`
@code_tooltip_get_pos_y = `get_pos_y()` 
获取无人机当前的 y 坐标。
y 坐标从南边的 `0` 开始，向北递增。

返回一个表示无人机当前 y 坐标的数字。

需要 `1` tick 执行。

示例：
`x, y = get_pos_x(), get_pos_y()`
@code_tooltip_get_world_size = `get_world_size()` 
获取农场的当前大小。

返回网格的南北方向边长。

需要 `1` tick 执行。

示例：
`for i in range(get_world_size()):
    move(North)`
@code_tooltip_get_entity_type = `get_entity_type()` 
判断无人机下方实体的类型。

如果地块为空，则返回 `None`，否则返回无人机下方实体的类型。

需要 `1` tick 执行。

示例：
`if get_entity_type() == Entities.Grass:
    harvest()`
@code_tooltip_get_ground_type = `get_ground_type()` 
判断无人机下方地块的类型。

返回无人机下方地块的类型。

需要 `1` tick 执行。

示例：
`if get_ground_type() != Grounds.Soil:
    till()`
@code_tooltip_get_time = `get_time()` 
获取当前游戏时间。

返回自游戏开始以来的秒数。

需要 `1` tick 执行。

示例：
`start = get_time()

do_something()

time_passed = get_time() - start`
@code_tooltip_get_tick_count = `get_tick_count()`
用于测量已执行的 tick 数。

返回自执行开始以来已执行的 tick 数。

需要 `0` tick 执行。

示例：
`do_something()

print(get_tick_count())`
@code_tooltip_use_item = `use_item(item, n=1)` 
尝试使用指定的 `item` `n` 次。只能用于某些物品，包括 `Items.Water`、`Items.Fertilizer`。

如果使用了物品，则返回 `True`，否则返回 `False`。

如果成功，需要 `200` ticks 执行，否则需要 `1` tick。

示例：
`use_item(Items.Fertilizer)`
@code_tooltip_get_water = `get_water()` 
获取无人机下方地块的当前含水量。

返回无人机下方地块的含水量，为一个介于 `0` 和 `1` 之间的数字。

需要 `1` tick 执行。

示例：
`if get_water() < 0.5:
    use_item(Items.Water)`
@code_tooltip_do_a_flip = `do_a_flip()` 
让无人机做一次翻转！此操作不受速度升级影响。

返回 `None`。

需要 1 秒执行。

示例：
`while True:
    do_a_flip()`
@code_tooltip_pet_the_piggy = `pet_the_piggy()` 
摸摸小猪！此操作不受速度升级影响。

返回 `None`。

需要 1 秒执行。

示例：
`while True:
    pet_the_piggy()`
@code_tooltip_print = `print(*args)` 
用烟雾将所有 `args` 打印在无人机上方的空中。此操作不受速度升级影响。
可以一次打印多个值。

返回 `None`。

需要 1 秒执行。

示例：
`print("ground:", get_ground_type())`
@code_tooltip_len = `len(collection)` 
获取列表、集合、字典或元组中的元素数量。

返回 `collection` 的长度。

需要 `1` tick 执行。

示例：
`for i in range(len(list)):
    list[i] += 1`
@code_tooltip_list = `list(collection = None)`
创建一个新列表。
如果 `collection` 是 None，则创建一个空列表。
如果 `collection` 是任何序列，则用该序列的元素创建一个新列表。

返回一个列表。

需要 `1 + len(collection)` ticks 执行。

示例：
`new_list = list((1,2,3))`
@code_tooltip_dict = `dict(dictionary = None)`
创建一个新字典。
如果 `dictionary` 是 None，则创建一个空字典。
如果 `dictionary` 是一个字典，则创建它的一个副本。

返回一个字典。

需要 `1 + len(dictionary)` ticks 执行。

示例：
`new_dict = dict()`
@code_tooltip_set = `set(collection = None)`
创建一个新集合。
如果 `collection` 是 None，则创建一个空集合。
如果 `collection` 是一个值的集合，则用这些值创建一个新集合。

返回一个集合。

需要 `1 + len(collection)` ticks 执行。

示例：
`new_set = set((1,2,3))`
@code_tooltip_str = `str(object)`

返回 `object` 的字符串表示形式。

需要 `1` tick 执行。

示例：
`string = str(1000)`
@code_tooltip_set_execution_speed = `set_execution_speed(speed)`
限制程序的执行速度，以便更好地观察执行效果。

`speed` 为 `1` 是无人机没有任何速度升级时的速度。
`speed` 为 `8` 使代码执行速度达到 `8` 倍，相当于无人机经过 `3` 次速度升级后的速度。
`speed` 为 `0.5` 使代码以无速度升级时的一半速度执行。半速执行有助于观察代码的执行过程。

如果 `speed` 快于当前可达到的执行速度上限，则直接以最大速度运行。

如果 `speed` 为 `0` 或负数，速度将恢复为最大速度。
当执行停止时，效果也会停止。

返回 `None`。

需要 `200` ticks 执行。

示例：
`set_execution_speed(1)`
@code_tooltip_set_world_size = `set_world_size(size)`
限制农场的大小，以便更好地观察农场情况。
同时会清空农场并重置无人机位置。
将农场设置为 `size` x `size` 的网格。
可能的最小 `size` 是 `3`。
当 `size` 小于 `3` 时，会将网格恢复到其完整大小。
当执行停止时，效果也会停止。

返回 `None`。

需要 `200` ticks 执行。

示例：
`set_world_size(5)`
@code_tooltip_num_items = `num_items(item)` 
查询你当前拥有多少 `item`。

返回你物品栏中当前 `item` 的数量。

需要 `1` tick 执行。

示例：
`if num_items(Items.Fertilizer) > 0:
    use_item(Items.Fertilizer)`
@code_tooltip_get_cost = `get_cost(thing)` 
获取一个 `thing` 的成本。

如果 `thing` 是一个实体，获取种植它的成本。
如果 `thing` 是一个解锁项，获取解锁它的成本。

返回一个字典，其中键是物品，值是数量。每个物品映射到它需要的数量。
当用于已经达到最高等级的可升级解锁项时，返回 `{}`。

需要 `1` tick 执行。

示例：
`cost = get_cost(Unlocks.Carrots)
for item in cost:
    if num_items(item) < cost[item]:
        print("物品不足，无法解锁胡萝卜")`
@code_tooltip_clear = `clear()` 
移除农场上的一切，将无人机移回 `(0,0)` 位置，并将帽子换回草帽。

返回 `None`。

需要 `200` ticks 执行。

示例：
`clear()`
@code_tooltip_get_companion = `get_companion()` 
获取无人机下方植物的偏好伴生植物。

返回一个形式为 `(companion_type, (companion_x_position, companion_y_position))` 的元组。

需要 `1` tick 执行。

示例：
`companion = get_companion()
if companion != None:
	print(companion)`
@code_tooltip_unlock = `unlock(unlock)` 
效果与在科技树中点击对应 `unlock` 的按钮完全相同。

如果解锁成功，则返回 `True`，否则返回 `False`。

如果成功，需要 `200` ticks 执行，否则需要 `1` tick。

示例：
`unlock(Unlocks.Carrots)`
@code_tooltip_num_unlocked = `num_unlocked(thing)`
用于检查某个解锁项、实体、地块、物品或帽子是否已经解锁。

如果 `thing` 可升级，则返回 `1` 加上 `thing` 已升级的次数。如果不可升级，则在 `thing` 已解锁时返回 `1`，否则返回 `0`。

需要 `1` tick 执行。

示例：
`plant(Entities.Bush)
n_substance = get_world_size() * num_unlocked(Unlocks.Mazes)
use_item(Items.Weird_Substance, n_substance)`
@code_tooltip_reset = `reset()` 
将农场重置为 1x1 的方块，移除所有资源并锁定大部分解锁项。
此操作不会移除你的任何代码。

返回 `None`。

需要 `200` ticks 执行。

示例：
`reset()`
@code_tooltip_measure = `measure(direction = None)` 
可以测量某些实体的一些值。效果取决于实体。

如果 `direction` 不为 `None`，则测量给定方向上的相邻实体。

返回向日葵的花瓣数量。
返回宝藏或苹果的下一个位置。
返回仙人掌的大小。
返回南瓜的一个神秘数字。
对所有其他实体返回 `None`。

需要 `1` tick 执行。

示例：
`num_petals = measure()`
@code_tooltip_leaderboard_run = `leaderboard_run(leaderboard, file_name, speedup)`
使用指定的 `file_name` 作为起点，为 `leaderboard` 开始一次计时模拟。
`speedup` 设置起始加速倍率。

返回 `None`。

需要 `200` ticks 执行。

示例：
`leaderboard_run(Leaderboards.Fastest_Reset, "full_run", 256)`
@code_tooltip_simulate = `simulate(filename, sim_unlocks, sim_items, sim_globals, seed, speedup)`
使用指定的 `filename` 作为起点，为排行榜开始一次模拟。

`sim_unlocks`：一个包含起始解锁项的序列。
`sim_items`：一个将物品映射到数量的字典。模拟将以这些物品开始。
`sim_globals`：一个将变量名映射到值的字典。模拟开始时，这些变量将存在于全局作用域中。
`seed`：模拟的随机种子。必须是正整数。
`speedup`：起始加速倍率。

返回运行模拟所花费的时间。

需要 `200` ticks 执行。

示例：
`filename = "f1"
sim_unlocks = Unlocks
sim_items = {Items.Carrot : 10000, Items.Hay : 50}
sim_globals = {"a" : 13}
seed = 0
speedup = 64

run_time = simulate(filename, sim_unlocks, sim_items, sim_globals, seed, speedup)`
@code_tooltip_spawn_drone = `spawn_drone(filename)`
在运行 `spawn_drone(function)` 命令的无人机相同位置生成一个新的无人机。新无人机随后开始执行指定的函数。完成后，它将自动消失。

返回新无人机的句柄；如果所有无人机都已生成，则返回 `None`。

如果生成了无人机，需要 `200` ticks 执行，否则需要 `1` tick。

示例：
`def harvest_column():
    for _ in range(get_world_size()):
        harvest()
        move(North)

while True:
    if spawn_drone(harvest_column):
        move(East)`

@code_tooltip_wait_for = `wait_for(drone)`
等待直到给定的 `drone` 终止。

返回 `drone` 正在运行的函数的返回值。

如果等待的 `drone` 已经完成，需要 `1` tick 执行。

示例：
`def get_entity_type_in_direction(dir):
    move(dir)
    return get_entity_type()

def zero_arg_wrapper():
    return get_entity_type_in_direction(North)
handle = spawn_drone(zero_arg_wrapper)
print(wait_for(handle))`

@code_tooltip_has_finished = `has_finished(drone)`
检查给定的 `drone` 是否已完成。

如果 `drone` 已完成，则返回 `True`，否则返回 `False`。

需要 `1` tick 执行。

示例：
`drone = spawn_drone(function)
while not has_finished(drone):
    do_something_else()
result = wait_for(drone)`

@code_tooltip_max_drones = `max_drones()`

返回你在农场中最多可以拥有的无人机数量。

需要 `1` tick 执行。

示例：
`while num_drones() < max_drones():
 spawn_drone("文件名")
 move(East)`

@code_tooltip_num_drones = `num_drones()`

返回当前农场中的无人机数量。

需要 `1` tick 执行。

示例：
`while num_drones() < max_drones():
    spawn_drone("some_file_name")
    move(East)`

@code_tooltip_quick_print = `quick_print(*args)`
像 `print(*args)` 一样打印一个值，但它不会停下来将其写到空中，所以只能在输出页面上找到。

返回 `None`。

需要 `0` ticks 执行。

示例：
`quick_print("嗨，老妈")`
@code_tooltip_change_hat = `change_hat(hat)`
将无人机的帽子更改为 `hat`。

返回 `None`。

需要 `200` ticks 执行。

示例：
`change_hat(Hats.Dinosaur_Hat)`

@code_tooltip_max = `max(*args)`
获取一个元素序列或多个传入参数中的最大值。
可用于数字和字符串。

`max(a,b,c)`：返回 `a`、`b` 和 `c` 中的最大值。
`max(sequence)`：返回序列中所有值的最大值。

执行所需的 tick 等于比较次数。

示例：
`max([3,6,34,16])`
@code_tooltip_min = `min(*args)`
获取一个元素序列或多个传入参数中的最小值。
可用于数字和字符串。

`min(a,b,c)`：返回 `a`、`b` 和 `c` 中的最小值。
`min(sequence)`：返回序列中所有值的最小值。

执行所需的 tick 等于比较次数。

示例：
`min([3,6,34,16])`
@code_tooltip_abs = `abs(number)`
计算一个数的绝对值。

如果 `number` 是正数，则返回 `number`，否则返回 `-number`。

需要 1 tick 执行。

示例：
`abs(-69)`
@code_tooltip_random = `random()`
抽取一个介于 0（含）和 1（不含）之间的随机数。

返回该随机数。

需要 `1` tick 执行。

示例：
`def random_elem(list):
	index = random() * len(list) // 1
	return list[index]`
@code_tooltip_append = `list.append(element)` 
将 `element` 添加到 `list` 的末尾。

返回 `None`。

需要 `1` tick 执行。

示例：
`list = []
list.append(1)`
@code_tooltip_add = `set.add(element)` 
将 `element` 添加到 `set` 中。

返回 `None`。

执行所需的 tick 等于 `元素大小`。

示例：
`set = {0}
set.add(1)`
@code_tooltip_remove = `collection.remove(element)` 
从 `collection` 中移除第一次出现的 `element`。

返回 `None`。

在集合上执行所需的 tick 等于 `元素大小`，在列表上执行所需的 tick 等于比较次数 + 移位次数。

示例：
`list = [True, False, None]
list.remove(False)`
@code_tooltip_pop = `collection.pop()` 
从列表中移除最后一个元素，或从字典中移除指定的元素。
`list.pop(i)` 从 `list` 中移除索引为 `i` 的元素。

返回被移除的元素。

在字典上执行所需的 tick 等于 `键大小`，在列表上执行所需的 tick 等于 `len(list) - i + 1`。

示例：
`list = [True, False, None]
list.pop(0)`
@code_tooltip_insert = `list.insert(i, element)` 
将 `element` 插入到 `list` 的索引 `i` 处。

返回 `None`。

需要 `len(list) - i + 1` ticks。

示例：
`list = [1,2]
list.insert(0, 0)`
@code_tooltip_Items = 包含物品栏中可能存在的所有物品。可以使用 `for` 循环进行迭代。
@code_tooltip_Entities = 包含所有植物类型。可以使用 `for` 循环进行迭代。
@code_tooltip_Grounds = 包含所有可能的地块类型。可以使用 `for` 循环进行迭代。
@code_tooltip_Unlocks = 包含研究菜单中所有的解锁项和升级项。可以使用 `for` 循环进行迭代。
@code_tooltip_Hats = 包含所有帽子类型。可以使用 `for` 循环进行迭代。
@code_tooltip_Leaderboards = 包含所有排行榜类别。可以使用 `for` 循环进行迭代。
@code_tooltip_for = 一种迭代序列中所有元素的循环。一些编程语言称之为 "foreach" 循环。
@code_tooltip_while = 循环直到条件为假。
@code_tooltip_def = 定义一个函数。
@code_tooltip_True = 一个始终为真的布尔值。
@code_tooltip_False = 一个始终为假的布尔值。
@code_tooltip_if = 如果条件为 `True`，则执行代码。
@code_tooltip_else = 如果前一个 `if` 条件为 `False`，则执行代码。
@code_tooltip_elif = 和以下代码作用相同：
`else:
    if condition:`
@code_tooltip_None = 一个表示“没有值”的值。
@code_tooltip_continue = 立即继续下一次循环迭代。如果有嵌套循环，则始终影响最内层的循环。
@code_tooltip_break = 跳出循环，并继续执行循环之后的语句。如果有嵌套循环，则始终影响最内层的循环。
@code_tooltip_North = 屏幕上的向上方向。除非你把屏幕转过来。
@code_tooltip_East = 屏幕上的向右方向。除非你把屏幕转过来。
@code_tooltip_South = 屏幕上的向下方向。除非你把屏幕转过来。
@code_tooltip_West = 屏幕上的向左方向。除非你把屏幕转过来。
@code_tooltip_not = `not True` 是 `False`，`not False` 是 `True`。
@code_tooltip_and = 对第一个操作数求值。若结果为假值（`False`、`0` 和空集合），则立即返回该值（短路求值），否则，对第二个操作数求值并返回相应值。
@code_tooltip_or = 对第一个操作数求值。若结果为真值（除了 `False`、`0` 和空集合之外的任何值），则立即返回该值（短路求值），否则，对第二个操作数求值并返回相应值。
@code_tooltip_return = 用于从函数中返回值。
@code_tooltip_pass = 什么也不做。由于不允许空代码块，因此必要时可用它进行填充。